import type {
  AjaxPagingResult,
  TeamsInfo,
  TeamsQueryListParams,
  TeamsSaveOrUpdateParams,
} from '@/types'

const controller = getAjaxBaseUrl('/teams', '/energy')

/** 新增或修改班组分时信息 */
export function saveOrUpdate(params: Partial<TeamsSaveOrUpdateParams>) {
  return post(`${controller}/saveOrUpdateTeams`, params)
}

/** 查询班组分时信息列表 */
export function queryList(params: Partial<TeamsQueryListParams>) {
  return post<AjaxPagingResult<TeamsInfo[]>>(
    `${controller}/loadTeamsList`,
    params,
  )
}

/** 删除班组分时信息  */
export function deleteById(id: number) {
  return get(`${controller}/deleteTeams`, { id })
}
